Map = {
	timesCalled: 0,
	// This is build on HOPE!
	// HOPE was false ... fuck
	// Documentation is GOOD! So you can build on that. Not on hope.
	rooms:[
		[	// y0
			{'n':null,'e':null,'s':[0,0,1],'w':null},			// x0
			{'n':null,'e':null,'s':[1,1,1],'w':null},			// x1
			{'n':null,'e':[1,3,0],'s':null,'w':null},			// x2
			{'n':null,'e':null,'s':[0,3,1],'w':[1,2,0]},		// x3
		],
		[	// y1
			{'n':[0,0,0],'e':[0,1,1],'s':null,'w':null},		// x0
			{'n':[1,0,1],'e':null,'s':[1,1,2],'w':[0,0,1]},		// x1
			{'n':null,'e':[1,2,1],'s':[0,2,2],'w':null},		// x2
			{'n':null,'e':null,'s':null,'w':[0,2,2]},			// x3
		],
		[	// y3
			{'n':[0,0,2],'e':[0,1,3],'s':[1,1,4],'w':null},		// x0
			{'n':null,'e':[0,2,3],'s':[1,1,4],'w':[0,0,3]},		// x1
			{'n':[1,2,2],'e':[0,3,3],'s':[1,2,4],'w':[0,1,3]},	// x2
			{'n':null,'e':null,'s':[1,3,4],'w':[0,2,3]},		// x3
		],
		[	// y4
			{'n':[1,0,3],'e':null,'s':null,'w':null},			// x0
			{'n':[1,1,3],'e':null,'s':null,'w':null},			// x1
			{'n':[1,1,3],'e':null,'s':[0,2,5],'w':null},		// x2
			{'n':[1,3,3],'e':null,'s':null,'w':null},			// x3
		],
		[	// y5
			{'n':null,'e':null,'s':null,'w':null},				// x0
			{'n':null,'e':null,'s':null,'w':null},				// x1
			{'n':null,'e':null,'s':[0,2,4],'w':null},			// x2
			{'n':null,'e':null,'s':null,'w':null},				// x3
		],
	],
	getLayout: function(y,x){

		//console.log([x,y,Map.rooms[y][x]]);

		var layout = [
				[null,null,null],
				[null,null,null],
				[null,null,null]
			];

		if( y > Map.rooms.length-1 || x > Map.rooms[y].length-1 ){
			console.log('getRoom() ' + arguments.join(',') + 'didn\'t work!');
			return layout;
		} else {
			layout[1][1] = Map.rooms[y][x];
		}

		// Does this look crappy?
		// Actually it's very performant! Roll out every loop you have ;-)

		// North
		if( Map.rooms[y][x]['n'] !== null ) {

			layout[0][1] = Map.rooms[y-1][x];

		}


		// East
		if( Map.rooms[y][x]['e'] !== null ) {

			layout[1][2] = Map.rooms[y][x+1];

		}


		// South
		if( Map.rooms[y][x]['s'] !== null ) {

			layout[2][1] = Map.rooms[y+1][x];

		}


		// West
		if( Map.rooms[y][x]['w'] !== null ) {

			layout[1][0] = Map.rooms[y][x-1];

		}

		return layout;
	}

}